package com.zhanggm.springcould.user.service;

import com.zhanggm.springcloud.user.api.model.User;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    /**
     * 根据用户id，查询用户信息
     * @param id
     * @return
     */
    public User getUserById(Integer id){
        User user = new User();
        user.setId(id);
        user.setName("张三"+id);
        user.setUsername("zhangsan"+id);
        return user;
    }

    /**
     * 根据用户Id，查询用户名
     * @param id
     * @return
     */
    public String getUsernmaeById(Integer id){
        return getUserById(id).getUsername();
    }

}
